<template>
  <view class="index-ad">
    <view class="index-ad-left">
      <view class="index-ad-item index-ad-1" @click="itemClick('/pages/package3/introduce/introduce')">
        <view class="index-ad-content">
          <view class="index-ad-title">
            模块名称
          </view>
          <view class="index-ad-description">
            模块名称描述描述
          </view>
        </view>
        <image src="" mode=""></image>
      </view>
    </view>
    <view class="index-ad-right">
      <view class="index-ad-item index-ad-2" @click="itemClick('/pages/package1/postDemand/postDemand')">
        <view class="index-ad-content">
          <view class="index-ad-title">
            模块名称
          </view>
          <view class="index-ad-description">
            模块名称描述
          </view>
        </view>
        <image src="" mode=""></image>
      </view>
      <view class="index-ad-item index-ad-2" @click="itemClick({url:'/pages/package3/nursingHome/nursingHome',params:{distanceSort:1}})">
        <view class="index-ad-content">
          <view class="index-ad-title">
            模块名称
          </view>
          <view class="index-ad-description">
            模块名称描述
          </view>
        </view>
        <image src="" mode=""></image>
      </view>
    </view>
  </view>
</template>

<script>
  /**
   * @description 首页三个小广告
   * @date 2022-03-12
   * @version v1.0.1
   * @author gf
   */
  export default {
    name: 'index-ad',
    data() {
      return {
      }
    },
    methods: {
      // 首页导航点击
      itemClick(route) {
        this.$u.route(route)
      }
    }
  }
</script>

<style lang="scss">
  .index-ad {
    display: grid;
    margin-top: 40upx;
    margin-bottom: 40upx;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: row dense;
    gap:20upx;
    &-item {
      background-color: #F9F9F9;
      border-radius: 6upx;
      box-sizing: border-box;
      padding-left: 40upx;
      padding-top: 40upx;
      position: relative;
      overflow: hidden;
      &:active{
        opacity: 0.7;
      }
      image{
        width: 100%;
        height: 100%;
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 0;
      }
    }
    &-content{
      position: relative;
      z-index: 10;
    }
    &-description{
      font-size: 12px;
      color: #999999;
    }
    &-title{
      font-size: 17px;
      color: #333333;
      font-weight: bold;
      margin-bottom: 6upx;
    }
    .index-ad-1{
      height: calc(55vw - 25upx);
    }
    &-right{
      display: grid;
      grid-template-rows: 1fr 1fr;
      gap: 20upx;
    }
    .index-ad-2{
    }
  }
</style>
